﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <meta charset="utf-8">
    <include file="../inc/meta.inc" />
    <title>绑定手机号</title>
</head>

<body>
    <div id="vapp" v-cloak>
        <van-loading size="24px" type="spinner" v-if="loading">加载中...</van-loading>
        <div class="context" v-else>
            <van-sticky>
                <div class="header_info" v-if="!islogin" remark="未登录">
                    <div class="acc_photo nophoto"></div>
                    <div class="accInfo">
                        <div class="acc-name"> <a :href="commonaddr('signin')">未登录 </a>
                        </div>
                        <span class="acc-money"> ... </span>
                    </div>
                </div>
                <div class="header_info" v-if="islogin" remark="已经登录">
                    <header>
                        <a href="#" icon="&#xe727" style="font-size: 22px;" onclick="window.history.back(-1);"></a>
                        <a href="/mobi/" icon="&#xa020"></a>
                    </header>
                    <avatar :account="account" circle="true" size="60"></avatar>
                    <div class="accInfo">
                        <div class="acc-name">
                            <span v-if="account.Ac_Name!=''">{{account.Ac_Name}}</span>
                            <span v-else>（没有名字）</span>
                        </div>
                        <span class="acc-acname">{{account.Ac_AccName}}</span>

                    </div>
                </div>
            </van-sticky>
            <template v-if="islogin">
                <card>
                    <card-title>
                        <icon>&#xe66d</icon>手机号绑定
                    </card-title>
                    <card-context v-if="isbind">
                        <van-cell>
                            <template #title>
                                {{account.Ac_MobiTel1}}
                            </template>
                            <template #default>
                                <van-tag type="primary">已经绑定</van-tag>
                            </template>

                        </van-cell>
                        <van-cell>
                            <template #title>
                                <span></span>
                            </template>
                            <template #default>

                                <van-button type="warning" @click="phoneUnbind">
                                    <icon>&#xe7ad</icon>取消绑定
                                </van-button>
                            </template>

                        </van-cell>
                    </card-context>
                    <!-- 未绑定-->
                    <card-context v-else class="phonebind">
                        <div prop="phone">
                            <span>手机号</span>
                            <input type="text" tabindex="1"  v-model.trim='form.phone' autocomplete="off" v-model.trim='form.phone'
                                placeholder="手机号" />
                            <span class="tips"></span>
                        </div>
                        <div prop="sms">
                            <span>验证码</span>
                            <input type="text" tabindex="1" autocomplete="off" v-model.trim='form.sms'
                                placeholder="短信验证码" />
                            <div class="sms_handler">
                                <loading bubble v-if="loading_sms"></loading>
                                <span v-else-if="sms_seconds>0">{{sms_seconds}}秒后重发</span>
                                <span class="getsms" v-else @click="getsms">获取验证码</span>
                            </div>
                            <span class="tips"></span>
                        </div>
                        <van-cell>
                            <template #title>
                                <span></span>
                            </template>
                            <template #default>

                                <van-button type="primary" @click="phonebind">
                                    <icon>&#xe634</icon>确认绑定
                                </van-button>
                            </template>

                        </van-cell>
                    </card-context>
                </card>

            </template>
            <card v-else>
                <van-cell is-link>
                    <template #title>
                        <a icon="&#xe84d" :href="commonaddr('signin')">点击此处登录</a>
                    </template>
                </van-cell>

            </card>

        </div>
        <aside_menu ref='aside_menu' :account="account"></aside_menu>
        <footer_menu ref='footer_menu' :organ="organ"></footer_menu>
    </div>


</body>

</html>